<div>
    <ol class="breadcrumb" >
        <li> <i class="fa fa-anchor"></i>
            &nbsp;服务商管理
        </li>
        <li>服务商城市分布</li>
        <li style="float: right;" >
            <a href={:U("Services/addcity")} style="color: #ffffff">添加服务城市</a>
        </li>
    </ol>
    <div class="panel">
        <div class="panel-heading" > <i class="fa fa-list"></i>
            &nbsp;&nbsp;服务商城市分布列表
        </div>
        <table class="table table-bordered table-striped table-mcit">
            <thead>
            <tr>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>ID</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>服务商名称</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>分布城市名称</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>使用方式</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>办卡地址</button>
                </th>
                <th>
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>服务电话</button>
                </th>
                <th style="width: 20%">
                    <button class='btn btn-block btn-mcit' type='submit' name='' value=''>操作</button>
                </th>
            </tr>
            </thead>
            <tbody id="DataTableContent">
                <empty name="distribution">
                    <tr>
                        <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                            &nbsp;&nbsp;当前条件下没有数据</strong>
                        </td>
                    </tr>
                <else />
                    <volist name="distribution" id="data">
                        <tr align="center">
                            <td>
                                <p class="mcit-table-p">{$data.id}</p>
                            </td>
                            <td>
                                <p class="mcit-table-p">{$data.oper_name}</p>
                            </td>
                            <td>
                                <p class="mcit-table-p">{$data.oper_city}</p>
                            </td>
                            <td>
                                <p class="mcit-table-p">{$data.oper_pay_way}</p>
                            </td>
                            <td>
                                <p class="mcit-table-p" title="{$data.content}">{$data.content_text}</p>
                            </td>
                            <td>
                                <p class="mcit-table-p">{$data.oper_tel}</p>
                            </td>
                            <td>
                                <a class="btn btn-sm btn-warning" href="__URL__/detail/id/{$data.id}">
                                    <i class="fa fa-eye"></i>
                                    &nbsp;查看
                                </a>
                                <a class="btn btn-sm btn-warning" href="__URL__/editcity/id/{$data.id}">
                                    <i class="fa fa-edit"></i>
                                    &nbsp;修改
                                </a>
                                <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                                    <a class="btn btn-sm btn-danger delOper" data-id="{$data.id}">
                                        <i class="fa fa-trash-o"></i>
                                        &nbsp;删除
                                    </a>
                                <else /></if>
                            </td>
                        </tr>
                    </volist>
                </empty>
                <tr>
                    <td colspan="99" style="text-align:center">
                        <ul class="pagination">{$pageView}</ul>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
    $("#DataTableContent").on("click",'.delOper',function(){
        var id = $(this).attr('data-id');
        //alertify.success(id);
        alertify.confirm("确定要删除此信息吗？", function (e) {
            if (e) {
                $.ajax({
                    type: "POST",
                    url:  '{:U("Services/delCity")}',
                    data: {id:id},
                    dataType: "json",
                    success: function(data){
                        if(data.state==100){
                            alertify.success(data.msg);
                            location.reload(true);
                        }else{
                            alertify.error(data.msg);
                        }
                    }
                });
            } else {
                alertify.error("取消操作！");
            }
        }, "mcit_default");
    });
</script>